<template>
  <div>
    <table class="table1 owntable mb20 tableLayout" border="0" cellspacing="0" cellpadding="1" width="100%">
      <tr>
        <td width="150">采购品出库管理编号</td>
        <td>{{ item.number }}</td>
        <td width="150">采购类别</td>
        <td>{{ purchaseList[item.purchaseType] }}</td>
      </tr>
      <tr>
        <td>原材料批号</td>
        <td>{{ item.batchNumber || '-' }}</td>
       <td>出库日期</td>
       <td>{{ item.chukuDate }}</td>
      </tr>
      <tr>
        <td>管理部门</td>
        <td>{{ item.manageDeptName }}</td>
        <td>负责人</td>
        <td>{{ item.manageUserName }}</td>
      </tr>
      <tr>
        <td>编制部门</td>
        <td colspan="3">{{ item.createDeptName }}</td>
      </tr>
    </table>
    <div class="f14 mb20">{{ getTypeName(item.purchaseType)}}</div>
    <table class="table1 owntable mb20 " border="0" cellspacing="0" cellpadding="1" style="width: 100%;" v-if="item.purchaseType == 0">
      <tr>
        <td class="gray_bg">原材料名称</td>
        <td class="gray_bg">原材料规格型号</td>
        <td class="gray_bg">原材料编号</td>
        <td class="gray_bg">出库数量</td>
      </tr>
      <tr v-for="(v, i) in item.productList" :key="i">
        <td class="white_bg">{{ v.materialName }}</td>
        <td>{{ v.materialSku }}</td>
        <td class="white_bg">{{ v.materialNumber }}</td>
        <td>{{ v.qty }} {{ v.unit }}</td>
      </tr>
    </table>
    <table class="table1 owntable mb20" border="0" cellspacing="0" cellpadding="1" width="100%" v-if="item.purchaseType == 1">
      <tr>
        <td>设备名称</td>
        <td class="gray_bg">设备型号</td>
   	    <td>设备编号</td>
        <td class="gray_bg">出库数量</td>
      </tr>
      <tr v-for="(v, i) in item.deviceList" :key="i">
        <td class="white_bg">{{ v.deviceName }}</td>
        <td class="white_bg">{{ v.deviceModel }}</td>
        <td class="white_bg">{{ v.deviceNumber }}</td>
        <td class="white_bg">{{ v.qty }}{{ v.unit }}</td>
      </tr>
    </table>

    <table class="table1 owntable mb20" border="0" cellspacing="0" cellpadding="1" width="100%" v-if="item.purchaseType == 2">
      <tr>
        <td class="gray_bg">外包服务</td>
        <td class="gray_bg">出库数量</td>
      </tr>
      <tr v-for="(v, i) in item.outsourcingList" :key="i">
        <td class="white_bg">{{ v.outsourcingName }}</td>
        <td class="white_bg">{{ v.qty }}{{ v.unit }}</td>
      </tr>
    </table>

    <table class="table1 owntable mb20 " border="0" cellspacing="0" cellpadding="1" style="width: 100%;" v-if="item.purchaseType == 3">
      <tr>
        <td class="gray_bg">计算机应用软件名称</td>
        <td class="gray_bg">计算机应用软件版本号</td>
        <td class="gray_bg">入库数量</td>
      </tr>
      <tr v-for="(v, i) in item.softwareList" :key="i">
        <td class="white_bg">{{ v.softwareName }}</td>
        <td>{{ v.softwareVersion }}</td>
        <td class="white_bg">{{ v.qty }} {{ v.unit }}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  props: {
    item: {}
  },
  data() {
    return {
      dataList: []
    };
  },
  methods:{
    getTypeName(purchaseType){
      let purchaseTypeList=['原材料信息如下:','设备信息如下:','外包服务商信息如下:','计算机软件信息如下:'];
      return purchaseTypeList[purchaseType]
    }
  }
};
</script>

<style></style>
